load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "schemaexpr",
    srcs = [
        "check_constraint.go",
        "column.go",
        "computed_column.go",
        "computed_column_rewrites.go",
        "computed_exprs.go",
        "default_exprs.go",
        "doc.go",
        "expr.go",
        "hash_sharded_compute_expr.go",
        "name.go",
        "partial_index.go",
        "sequence_options.go",
        "unique_contraint.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/catalog/schemaexpr",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/clusterversion",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/catpb",
        "//pkg/sql/catalog/colinfo",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/funcdesc",
        "//pkg/sql/parser",
        "//pkg/sql/pgwire/pgcode",
        "//pkg/sql/pgwire/pgerror",
        "//pkg/sql/sem/builtins/builtinsregistry",
        "//pkg/sql/sem/cast",
        "//pkg/sql/sem/catid",
        "//pkg/sql/sem/eval",
        "//pkg/sql/sem/transform",
        "//pkg/sql/sem/tree",
        "//pkg/sql/sem/tree/treebin",
        "//pkg/sql/sem/volatility",
        "//pkg/sql/sessiondata",
        "//pkg/sql/sqlerrors",
        "//pkg/sql/types",
        "//pkg/util/errorutil/unimplemented",
        "@com_github_cockroachdb_errors//:errors",
    ],
)

go_test(
    name = "schemaexpr_test",
    size = "small",
    srcs = [
        "check_constraint_test.go",
        "column_test.go",
        "computed_column_rewrites_test.go",
        "expr_test.go",
        "partial_index_test.go",
        "testutils_test.go",
    ],
    data = glob(["testdata/**"]),
    embed = [":schemaexpr"],
    deps = [
        "//pkg/clusterversion",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/colinfo",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/tabledesc",
        "//pkg/sql/parser",
        "//pkg/sql/sem/builtins",
        "//pkg/sql/sem/catconstants",
        "//pkg/sql/sem/tree",
        "//pkg/sql/sem/volatility",
        "//pkg/sql/types",
        "//pkg/testutils/datapathutils",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "@com_github_cockroachdb_datadriven//:datadriven",
    ],
)
